home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik30.arc / QINIT.DOC < prev    next >
Text File  |  1991-01-09  |  12KB  |  238 lines

  1. { Qinit.doc - documentation for Qinit.inc                   ver 3.0, 08-31-87 }
  2.  
  3.   This file will help you figure out how the new IBM PS/2 systems are config-
  4.   ured as well as original equipment.  First, it is helpful to have a list of 
  5.   all the possible Alphanumeric (A/N or text) modes.  QWIK was not designed 
  6.   for the All Points Addressable (APA or graphics) modes.
  7.  
  8.           TABLE 1:  Hardware Specific Video Mode Characteristics
  9.   Mode Format Segment Display Box  MDA CGA EGA MCGA VGA PCjr PCC MaxPage 
  10.   ---- ------ ------- ------- ---- --- --- --- ---- --- ---- --- ------- 
  11.   0,1  40x25  B800:0  320x200 8x8       x   x   x    x   x    x     7    
  12.                       320x350 8x14          x        x              7    
  13.                       320x400 8x16              x                   7
  14.                       360x400 9x16                   x              7
  15.   2,3  80x25  B800:0  640x200 8x8       x                x    x     3    
  16.                       640x200 8x8           x        x              7 *
  17.                       640x350 8x14          x        x              7 *
  18.                       640x400 8x16              x                   7
  19.                       720x400 9x16                   x              7
  20.   7    80x25  B000:0  720x350 9x14  x                         x     0    
  21.                       720x350 9x14          x        x              7 *
  22.                       720x400 9x16                   x              7
  23.                       640x200 8x8                             x     3    
  24.  
  25. Legend:
  26.   Format  - Characters per row by the number of rows in the data area.
  27.   Segment - Address of the first character on page 0 of the display buffer.
  28.   Display - The pixel resolution for the data area excluding the border, 
  29.             horizontal by vertical.
  30.   Box     - The pixel resolution for each character, horizontal by vertical.
  31.   MDA     - Monochrome Display and Printer Adapter
  32.   CGA     - Color Graphics Adapter 
  33.   EGA     - Enhanced Graphics Adapter
  34.   PGC     - Professional Graphics Controller
  35.   MCGA    - Multi-Color Graphics Array
  36.   VGA     - Video Graphics Array
  37.   PCjr    - PC Junior
  38.   PCC     - PC Convertible
  39.   MaxPage - 0-based highest page number; e.g. 7 means there are 8 pages.
  40.   MD      - 5151 Monochrome Display
  41.   CD      - 5153 Color Display
  42.   ECD     - 5154 Enhanced Color Display
  43.  
  44. Notes:
  45.   1. The 0 and 2 modes suppress color burst only on composite displays (not 
  46.      RGB) only for CGA and EGA.
  47.   2. The PS/2 model 25 and 30 have an integrated MCGA.  The model 50 and 
  48.      above have an integrated VGA.
  49.   3. The 8514 High Content Color Display along with the 8514/A adapter 
  50.      produces a superset of the VGA for APA, but there is no differences in 
  51.      the A/N modes to the VGA when the adapter is in "VGA" mode.  See IBM 
  52.      documentation for Advanced Function Mode.
  53.   4. Reduce MaxPage to 3 if EGA only has 64K graphics memory installed for 
  54.      modes marked "*".  MaxPage of 7 is for 128K or more.
  55.   5. The PCC can have either an alternate MDA or CGA.  The LCD (model 5140) 
  56.      can emulate either the MDA or CGA modes, but the MDA mode is 640x200.
  57.   6. I currently have no information on the PGC.
  58.   7. To relieve cursor routine programming due to the multiple character box 
  59.      sizes, the VGA has a cursor emulation mode.  Qinit turns on the mode 
  60.      if PS/2 equipment is detected.  See CURSOR.DOC for emulation notes.
  61.  
  62.   Display Combination Code (DCC) - The PS/2 video BIOS has a new function 
  63.   that simplifies equipment detection called the Read/Write Display 
  64.   Combination Code.  Using interrupt $10 with AH = $1A00, the call will 
  65.   return the Active Display Device in BL and the Alternate Display Device in 
  66.   BH.  If the function is supported, it also returns $1A to AL.  The possible 
  67.   Display Device codes are:
  68.  
  69.      TABLE 2:  Display Combination Code
  70.      CODE  DESCRIPTION                       QWIK30 Constant
  71.      ----  --------------------------------  ---------------
  72.      $00 - No display                        NoDisplay
  73.      $01 - MDA with 5151 monochrome display  MdaMono
  74.      $02 - CGA with 5153/4 color display     CgaColor
  75.      $03 - reserved                          DCC3
  76.      $04 - EGA with 5153/4 color             EgaColor
  77.      $05 - EGA with 5151 monochrome          EgaMono
  78.      $06 - PGC with 5175 color               PgcColor
  79.      $07 - VGA with analog monochrome        VgaMono
  80.      $08 - VGA with analog color             VgaColor
  81.      $09 to $0A - reserved                   DCC9,DCC10
  82.      $0B - MCGA with analog monochrome       McgaMono
  83.      $0C - MCGA with analog color            McgaColor
  84.      $0D to $FE - reserved                   n/a
  85.      $FF - unknown                           Unknown
  86.  
  87.   HavePS2 - Qinit sets HavePS2 to true if the DCC is supported.  This means 
  88.   that the program has detected some kind of PS/2 equipment whether it is a 
  89.   standard Model 30, a PS/2 Display Adapter on an IBM XT, or the like.  It 
  90.   also means that either MCGA or VGA is present, but not necessarily 
  91.   active.  To know which, just check the DCC.
  92.  
  93.   Conforming to DCC - No results are obtained for the DCC on anything other 
  94.   than PS/2 equipment.  However, to be consistent, Qinit was reprogrammed 
  95.   to conform to the DCC for ALL equipment.  To see if a CGA is in use, 
  96.   simply check to see if ActiveDD=CgaColor.  Qinit only sets the parameters 
  97.   for the active display.  Although the alternate code is saved, it is only 
  98.   for testing purposes.  If you change text modes in a running program, 
  99.   Qinit should be executed again. 
  100.  
  101.   EGA Switches - By checking the value of this byte, you can determine the 
  102.   monitor connected to the EGA, the alternate video system, and the start 
  103.   up default.  The byte is a copy of how the dip switches are set on the 
  104.   card where on=0 and off=1.  The primary is the default.  When the ECD is 
  105.   set for 640x200, it is emulating the CD including the cursor mode.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.        TABLE 3: EGA dip switch configuration     
  112.        SWITCH  VALUE  PRIMARY               SECONDARY
  113.        ------  -----  --------------------  -------------------
  114.        0000    0      MDA + MD              EGA + CD - 40x25   
  115.        0001    1      MDA + MD              EGA + CD - 80x25   
  116.        0010    2      MDA + MD              EGA + ECD (640x200)
  117.        0011    3      MDA + MD              EGA + ECD (640x350)
  118.        0100    4      CGA + CD - 40x25      EGA + MD           
  119.        0101    5      CGA + CD - 80x25      EGA + MD           
  120.        0110    6      EGA + CD - 40x25      MDA + MD           
  121.        0111    7      EGA + CD - 80x25      MDA + MD           
  122.        1000    8      EGA + ECD (640x200)   MDA + MD           
  123.        1001    9      EGA + ECD (640x350)   MDA + MD           
  124.        1010   10      EGA + MD              CGA + CD - 40x25   
  125.        1011   11      EGA + MD              CGA + CD - 80x25   
  126.  
  127.  
  128.   EGA Information - The byte located at $0040:$0087 has the following 
  129.   information when the EGA (or VGA) is present:
  130.  
  131.        TABLE 4: EGA information
  132.        BITS  DESCRIPTION
  133.        ----  -------------------------------------------------
  134.        7     (0) Clear, (1) Keep video data after mode set
  135.        6,5   (00) 64k, (01) 128k, (10) 192k, (11) 256k, memory
  136.        4     Reserved
  137.        3     (0) EGA active, (1) EGA not active
  138.        2     (0) Disable,    (1) Enable wait-for-display
  139.        1     (0) CD/ECD,     (1) MD attached
  140.        0     (0) Active,     (1) Inactive CD emulation
  141.  
  142.  
  143.   PCC Exceptions - Since the PCC also does not support the DCC, a little 
  144.   hedging is done.  If the 5140 LCD is used in mode 7, the Active Display 
  145.   Device is set to MdaMono which is close enough.  This set up can be 
  146.   verified by testing if MaxPage=3.  The alternate display is found by using 
  147.   interrupt $10 with AH=$15.  The result is saved in PCCAltDD.  Of course 
  148.   the variable is undefined if a PCC is not used.  The possible types are:
  149.  
  150.      TABLE 5: PC Convertible Alternate Display Adapters
  151.      VARIABLE   MODEL  DESCRIPTION
  152.      --------   -----  --------------------
  153.      PCCAltDD = $   0 - No alternate adapter
  154.               = $5140 - LCD
  155.               = $5153 - CGA type
  156.               = $5151 - Monochrome type
  157.  
  158.  
  159.   System Identification - To get both the model and submodel, you must use 
  160.   interrupt $15 with AH=$C0 which only works on some computers.  If the 
  161.   carry flag is set on exit, then that interrupt is not supported, because 
  162.   there's no submodel number.  The alternative is to get the basic computer 
  163.   model by directly accessing the byte in memory at $F000:$FFFE.  The 
  164.   possible values are:
  165.  
  166.      TABLE 6:  System Identification Codes
  167.      SysID Sub-Model  SYSTEM              
  168.      ----- ---------  ---------------------------
  169.       $FF    n/a      IBM PC
  170.       $FE    n/a      IBM PC XT
  171.       $FD    n/a      IBM PCjr
  172.       $FC    n/a      IBM PC AT (6 MHz, 01/10/84)
  173.              $00      IBM PC AT (6 MHz, 06/10/85)
  174.              $01      IBM PC AT (8 MHz, 11/15/85)
  175.              $02      IBM PC XT (286)
  176.              $04      IBM PS/2 model 50
  177.              $05      IBM PS/2 model 60
  178.       $FB    $00      IBM PC XT (256/640)
  179.       $FA    $00      IBM PS/2 model 30
  180.              $01      IBM PS/2 model 25
  181.       $F9    $00      IBM PC Convertible
  182.       $F8    $00      IBM PS/2 model 80 (16 MHz)
  183.              $01      IBM PS/2 model 80 (20 MHz)
  184.               ?       IBM PS/2 model 70
  185.  
  186.   The essential variables set by Qinit are:
  187.  
  188.     VARIABLE      DESCRIPTION
  189.     ------------  ---------------------------------------------------------
  190.     Page0seg      Segment for the base page, page 0.
  191.     Qseg          Segment for Q writing which is altered when changing
  192.                     pages.
  193.     Qwait         Wait-for-retrace while Q writing.
  194.     MaxPage       Maximum possible 0-based page number.
  195.  
  196.  
  197.   The other variables set or located by Qinit are for your reference to 
  198.   help make decisions in your programs:  
  199.  
  200.     VARIABLE      DESCRIPTION
  201.     ------------  ---------------------------------------------------------
  202.     Vmode         Directly accesses the video mode code.
  203.     EgaRows       0-based number of rows on the screen for EGA or VGA.
  204.     EgaFontSize   1-based number of horizontal scan lines per character for
  205.                     EGA or VGA.
  206.     EgaInfo       (Described above)
  207.     EgaSwithces   (Described above)
  208.     CRTcolumns    1-based number of columns on the screen for any card.
  209.     HavePS2       Detects the presence of some type of IBM PS/2 equipment.
  210.     CardWait      Requirement for wait-for-retrace for the video "card".
  211.     SystemID      Code for the IBM computer in use.
  212.     SubModelID    Code for the sub-model of the IBM computer in use.
  213.     ActiveDD      Code for the Active Display Device.
  214.     AltDD         Code for the Alternate Display Device.
  215.     PCCAltDD      Code for the Alternate Display adapter on the PC 
  216.                     Convertible.
  217.     
  218.  
  219.   A recent discovery has shown that CGA cards do not need wait-for-retrace 
  220.   in 40 column modes 0 and 1.  Qinit was programmed to accommodate this.  
  221.   For other hardware, you can change Qwait to suit your needs, but CardWait 
  222.   should be left unchanged to save what Qinit detected.
  223.  
  224.   References - For more information on the new IBM PS/2 system, you can get 
  225.   the "IBM BIOS Interface Technical Reference Manual".  Other references 
  226.   include:
  227.     
  228.      IBM Personal System/2 Seminar Proceedings:
  229.        Volume 5, Number 2, Displays and Adapters, publication # G360-2678.
  230.        Volume 5, Number 4, Models 50, 60, 80, VGA, BIOS and Programming 
  231.           Considerations, publication # G360-2747.
  232.  
  233.   As always, the above information is subject to change without notice per 
  234.   IBM.
  235.  
  236.   IBM is the trademark for International Business Machines Corp. (but you 
  237.   already know that!)
  238.